package com.zrgk.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.zrgk.service.ConContentService;
import com.zrgk.service.OrderService;
import com.zrgk.util.PageUtil;

/**
 * 订单controller
 * @author DHF
 *
 */
@Controller
@RequestMapping(value="order.do")
public class OrderController {
	@Autowired
	@Qualifier(value="orderService")
	private OrderService orderService;
	@Autowired
	@Qualifier(value="conContentService")
	private ConContentService conContentService ;
	@RequestMapping(params="method=insert")
	public String insert()
	{
		return "/index.jsp";
	}
	@RequestMapping
	public String queryAll(HttpServletRequest request,@RequestParam(required=false,defaultValue="1",value="nowPage")int nowPage)
	{
		PageUtil pu = new PageUtil();
		Map<String, String> map = new HashMap<String, String>();
		if(nowPage!=0)
		{
			pu.setNowPage(nowPage);
		}
		pu.setSearchInfo(map);
		pu = conContentService.findConContentByPage1(pu);
		request.setAttribute("page", pu);
		return "/html/resource/order/placeanorder/list.jsp";
	}
	
}
